<html lang="java">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css"></link>
    <link rel="stylesheet" href="/css/bootstrap-datetimepicker.css"></link>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="/jquery-1.10.2.min.js"></script>
    <script src="/bootstrap.min.js"></script>
    <script src="/bootstrap-datetimepicker.min.js" charset="UTF-8"></script>
    <script type="text/javascript">
       window.onload = function () {
            //下拉框选中
            var mySelect = document.getElementById("selectCity");
            var opts = mySelect.options;
            for (var i = 0; i < opts.length; i++) {
               if (opts[i].value == "${type!'请选择'}") {
                    opts[i].selected = true;
                }
            }
        }
    </script>
</head>
<body  >
<h1>项目展示</h1>
<div class="row">
    <div class="col-lg-6">
        <form action="/getProjectList" method="post" class="form-inline" id="searchForm">
            <div class="form-group">
                <label>账号类型</label>
                <select class="form-control" name="type"  id="selectCity">
                    <option value="请选择">请选择</option>
                    <#list  types as typeselect>
                        <option>${typeselect!''}</option>
                    </#list>
                </select>
            </div>
            <div class="form-group">
                <label>公众号/名称</label>
                <input type="text" class="form-control" placeholder="公众号或名称" name="account" value="${account!''}">
            </div>
            <div class="form-group span6">
                <label>创建时间</label>
                    <input  size="10" type="date" id="startTime" name="startTime"
<#--                            <#if startTime??>-->
                            value="${(startTime?string('yyyy-MM-dd'))!}">
                -
<#--                            </#if>>-->
                <input  size="10" type="date" id="endTime" name="endTime"
<#--                        <#if endTime??>-->
                        value="${(endTime?string('yyyy-MM-dd'))!}">
<#--                </#if>-->
            </div>
            <div class="form-group">
                <button type="submit" class="btn">查询</button> <button type="button" class="btn btn-success">添加</button>
            </div>
        </form>

        <table class="table table-striped table-bordered" style="margin-top:20px">
            <tr>
                <td>ID</td>
                <td>公众号</td>
                <td>名称</td>
                <td>类型</td>
                <td>创建时间</td>
                <td>认证</td>
                <td  colspan="2">操作</td>
            </tr>
            <#list  projectPage.list as project>
                <tr>
                    <td>${project.id!''}</td>
                    <td>${project.account!''}</td>
                    <td>${project.name!''}</td>
                    <td>${project.type!''}</td>
                    <td>${project.createTime?string('yyyy-MM-dd')}</td>
                    <td>${project.status!''}</td>
                    <td colspan="2">
                        <a href="/findProject?id=${project.id!''}">修改</a>
                        <a href="/deleteProject?id=${project.id!''}">删除</a>
                    </td>
                </tr>
            </#list>
        </table>
        <ul class="pagination">
            <!--不可点击的样式-->
            <li class="disabled"><a href="/getProjectList?type=${type!''}&account=${account!''}&startTime=${(startTime?string('yyyy-MM-dd'))!}&endTime=${(endTime?string('yyyy-MM-dd'))!}">首页</a></li>
            <li><a href="/getProjectList?index=${projectPage.prePage!''}&type=${type!''}&account=${account!''}&startTime=${(startTime?string('yyyy-MM-dd'))!}&endTime=${(endTime?string('yyyy-MM-dd'))!}">上一页</a></li>
            <li><a href="/getProjectList?index=${projectPage.nextPage!''}&type=${type!''}&account=${account!''}&startTime=${(startTime?string('yyyy-MM-dd'))!}&endTime=${(endTime?string('yyyy-MM-dd'))!}">下一页</a></li>
            <li class="disabled" ><a href="/getProjectList?index=${projectPage.pages!''}&type=${type!''}&account=${account!''}&startTime=${(startTime?string('yyyy-MM-dd'))!}&endTime=${(endTime?string('yyyy-MM-dd'))!}">末页</a></li>
        </ul>
    </div>
</div>
<script>
    $(function () {
        $('#startTime').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            minView: 2
        });
        $('#endTime').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            minView: 2
        });
    })
</script>

</body>
</html>